import Vue from 'vue'
import Router from 'vue-router'

/**** 首页模块--开始 ****/
import download from '../components/download/download.vue'
import register from '../components/register/register.vue'
import Share from '../components/Share/Share.vue'
import ourDynamic from '../components/Share/ourDynamic.vue'
import Knowledge from '../components/Share/Knowledge.vue'

Vue.use(Router)
const router = new Router({
    routes: [
        {
            path: '/',
            redirect: '/register'
        },
        // 首页
        {
            path: '/download',
            component: download,
            name: 'download',
            meta: { title: '下载' }
        },
        {
            path: '/register',
            component: register,
            name: 'register',
            meta: { title: '注册' }
        },
        {
            path: '/Share',
            component: Share,
            name: 'Share',
            meta: { title: '详情' }
        },
        {
            path: '/ourDynamic',
            component: ourDynamic,
            name: 'ourDynamic',
            meta: { title: '详情' }
        },
        {
            path: '/Knowledge',
            component: Knowledge,
            name: 'Knowledge',
            meta: { title: '详情' }
        }
    ],
    linkActiveClass: 'active'
})
router.beforeEach((to, from, next) =>{
    document.title = to.meta.title;
    next();
})
export default router

